home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-10-03 | 27.8 KB | 1,000 lines |
- *** Makefile Sun May 20 09:40:08 1990
- --- ../ppp/Makefile Fri Oct 4 10:58:21 1991
- ***************
- *** 2,31 ****
- # The KPPP directory contains the system include files.
- # It is normally /usr/include.
- # -DSTREAMS for SUN OS
- ! KPPP=include
- ! OBJS= ppp.o magic.o fsm.o lcp.o ipcp.o upap.o logwtmp.o
- ! CFLAGS= -g -I${KPPP} -DDEBUGFSM -DDEBUGLCP -DDEBUGIPCP -DDEBUGUPAP -DSTREAMS -DBSD=43
- SOURCE= README Readme.streams vax.diff Makefile ppp.c ppp.h fsm.c fsm.h \
- lcp.c lcp.h ipcp.c ipcp.h upap.c upap.h magic.c magic.h if_ppp.c \
- ! if_ppp.h ppp_if.c ppp_str.h ppp_async.c slip_var.h slcompress.c slcompress.h slstats.c logwtmp.c
-
- all: ppp slstats
-
- ! ppp: ${OBJS}
- ! ${CC} -o ppp -g ${OBJS}
-
- slstats: slstats.c
- ! $(CC) -o slstats -g -DPPP slstats.c
-
- - ppp.shar: $(SOURCE)
- - ./shar -b $(SOURCE) > ppp.shar
- -
- ppp.tar: $(SOURCE)
- tar -cvf ppp.tar $(SOURCE)
-
- ! ppp.o: magic.h ppp.h fsm.h lcp.h ipcp.h upap.h
- ! magic.o: magic.c magic.h
- ! fsm.o: ppp.h fsm.h
- ! lcp.o: ppp.h fsm.h lcp.h
- ! ipcp.o: ppp.h fsm.h ipcp.h
- ! upap.o: ppp.h upap.h
- --- 2,104 ----
- # The KPPP directory contains the system include files.
- # It is normally /usr/include.
- # -DSTREAMS for SUN OS
- ! PPPSRCS= ppp.c magic.c fsm.c lcp.c ipcp.c upap.c logwtmp.c
- ! SLSTATSRCS= slstats.c
- !
- ! PPPOBJS= ppp.o magic.o fsm.o lcp.o ipcp.o upap.o logwtmp.o
- !
- ! CFLAGS= -g -DDEBUGFSM -DDEBUGLCP -DDEBUGIPCP -DDEBUGUPAP -DSTREAMS \
- ! -DBSD=43 -DPPP
- SOURCE= README Readme.streams vax.diff Makefile ppp.c ppp.h fsm.c fsm.h \
- lcp.c lcp.h ipcp.c ipcp.h upap.c upap.h magic.c magic.h if_ppp.c \
- ! if_ppp.h ppp_if.c ppp_str.h ppp_async.c slip_var.h slcompress.c slcompress.h slstats.c logwtmp.c ppp.8
-
- all: ppp slstats
-
- ! ppp: $(PPPOBJS)
- ! $(CC) $(CFLAGS) -o ppp $(PPPOBJS)
-
- slstats: slstats.c
- ! $(CC) $(CFLAGS) -o slstats slstats.c
-
- ppp.tar: $(SOURCE)
- tar -cvf ppp.tar $(SOURCE)
-
- ! ppp.tar.Z: ppp.tar
- ! compress ppp.tar
- !
- ! clean:
- ! rm -f $(PPPOBJS) ppp slstats *~ #* core make
- !
- ! depend:
- ! makedepend $(CFLAGS) $(PPPSRCS) $(SLSTATSRCS)
- !
- ! # DO NOT DELETE THIS LINE -- make depend depends on it.
- !
- ! ppp.o: /usr/include/stdio.h /usr/include/signal.h /usr/include/sys/signal.h
- ! ppp.o: /usr/include/vm/faultcode.h /usr/include/errno.h
- ! ppp.o: /usr/include/sys/errno.h /usr/include/fcntl.h
- ! ppp.o: /usr/include/sys/fcntlcom.h /usr/include/sys/stdtypes.h
- ! ppp.o: /usr/include/sys/stat.h /usr/include/sys/types.h
- ! ppp.o: /usr/include/sys/sysmacros.h /usr/include/pwd.h /usr/include/syslog.h
- ! ppp.o: /usr/include/netdb.h /usr/include/utmp.h /usr/include/sys/param.h
- ! ppp.o: /usr/include/machine/param.h /usr/include/sys/socket.h
- ! ppp.o: /usr/include/sys/time.h /usr/include/sys/time.h
- ! ppp.o: /usr/include/sys/callout.h /usr/include/net/if.h
- ! ppp.o: /usr/include/sys/stream.h /usr/include/sys/stropts.h
- ! ppp.o: /usr/include/sys/ioccom.h /usr/include/sys/termios.h
- ! ppp.o: /usr/include/sys/ttydev.h /usr/include/sys/ttycom.h
- ! ppp.o: /usr/include/sys/conf.h /usr/include/pixrect/pr_impl_util.h magic.h
- ! ppp.o: ppp.h ppp_str.h fsm.h lcp.h ipcp.h upap.h patchlevel.h
- ! magic.o: /usr/include/stdio.h /usr/include/sys/types.h
- ! magic.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
- ! magic.o: /usr/include/sys/time.h /usr/include/sys/time.h magic.h
- ! fsm.o: /usr/include/stdio.h /usr/include/sys/types.h
- ! fsm.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
- ! fsm.o: /usr/include/sys/stream.h /usr/include/sys/socket.h
- ! fsm.o: /usr/include/net/if.h ppp.h ppp_str.h /usr/include/sys/ioccom.h fsm.h
- ! lcp.o: /usr/include/stdio.h /usr/include/sys/ioctl.h
- ! lcp.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
- ! lcp.o: /usr/include/sys/ttold.h /usr/include/sys/ioccom.h
- ! lcp.o: /usr/include/sys/ttycom.h /usr/include/sys/filio.h
- ! lcp.o: /usr/include/sys/sockio.h /usr/include/sys/types.h
- ! lcp.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
- ! lcp.o: /usr/include/sys/socket.h /usr/include/sys/time.h
- ! lcp.o: /usr/include/sys/time.h /usr/include/net/if.h
- ! lcp.o: /usr/include/netinet/in.h /usr/include/sys/stream.h ppp.h ppp_str.h
- ! lcp.o: fsm.h lcp.h
- ! ipcp.o: /usr/include/stdio.h /usr/include/sys/ioctl.h
- ! ipcp.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
- ! ipcp.o: /usr/include/sys/ttold.h /usr/include/sys/ioccom.h
- ! ipcp.o: /usr/include/sys/ttycom.h /usr/include/sys/filio.h
- ! ipcp.o: /usr/include/sys/sockio.h /usr/include/sys/types.h
- ! ipcp.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
- ! ipcp.o: /usr/include/sys/socket.h /usr/include/sys/time.h
- ! ipcp.o: /usr/include/sys/time.h /usr/include/net/if.h
- ! ipcp.o: /usr/include/net/route.h /usr/include/netinet/in.h
- ! ipcp.o: /usr/include/sys/stream.h ppp.h ppp_str.h fsm.h ipcp.h
- ! upap.o: /usr/include/stdio.h /usr/include/sys/types.h
- ! upap.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
- ! upap.o: /usr/include/sys/time.h /usr/include/sys/time.h
- ! upap.o: /usr/include/sys/socket.h /usr/include/net/if.h
- ! upap.o: /usr/include/sys/stream.h ppp.h ppp_str.h /usr/include/sys/ioccom.h
- ! upap.o: upap.h
- ! logwtmp.o: /usr/include/sys/types.h /usr/include/sys/stdtypes.h
- ! logwtmp.o: /usr/include/sys/sysmacros.h /usr/include/sys/file.h
- ! logwtmp.o: /usr/include/sys/fcntlcom.h /usr/include/sys/stat.h
- ! logwtmp.o: /usr/include/sys/time.h /usr/include/sys/time.h
- ! logwtmp.o: /usr/include/utmp.h
- ! slstats.o: /usr/include/sys/param.h /usr/include/machine/param.h
- ! slstats.o: /usr/include/sys/signal.h /usr/include/vm/faultcode.h
- ! slstats.o: /usr/include/sys/mbuf.h /usr/include/sys/types.h
- ! slstats.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
- ! slstats.o: /usr/include/sys/vmmac.h /usr/include/sys/socket.h
- ! slstats.o: /usr/include/sys/file.h /usr/include/sys/fcntlcom.h
- ! slstats.o: /usr/include/sys/stat.h /usr/include/machine/pte.h
- ! slstats.o: /usr/include/ctype.h /usr/include/errno.h /usr/include/sys/errno.h
- ! slstats.o: /usr/include/nlist.h /usr/include/stdio.h /usr/include/signal.h
- ! slstats.o: /usr/include/net/if.h /usr/include/netinet/in.h
- ! slstats.o: /usr/include/netinet/in_systm.h /usr/include/netinet/ip.h
- ! slstats.o: /usr/include/netinet/ip_var.h slcompress.h
- ! slstats.o: /usr/include/sys/slip_var.h /usr/include/sys/stream.h
- ! slstats.o: /usr/include/sys/stropts.h /usr/include/sys/ioccom.h ppp_str.h
- *** ipcp.h Fri Aug 16 10:30:10 1991
- --- ../ppp/ipcp.h Mon Sep 30 23:51:34 1991
- ***************
- *** 23,32 ****
- --- 23,47 ----
- #define CI_ADDRS 1 /* IP Addresses */
- #define CI_COMPRESSTYPE 2 /* Compression Type */
-
- + #define MAX_STATES 16 /* from slcompress.h */
- +
- + #define IPCP_VJMODE_OLD 1 /* "old" mode (option # = 0x0037) */
- + #define IPCP_VJMODE_CURRENT 2 /* "current"mode (option # = 0x002d) */
- + #define IPCP_VJMODE_DRAFT 3 /* "draft" mode (option # = 0x002d, */
- + /* maxslot and slot number */
- + /* compression from Aug. 1991 */
- + /* ipcp draft RFC) */
- +
- + #define IPCP_VJ_COMP 0x002d /* current value for VJ compression option*/
- + #define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */
- + /* compression option*/
- +
- typedef struct ipcp_options {
- int neg_addrs : 1; /* Negotiate IP Addresses? */
- u_long ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */
- int neg_vj : 1; /* Van Jacobson Compression? */
- + u_char maxslotindex, cflag; /* fields for Aug. 1991 Draft VJ */
- + /* compression negotiation */
- } ipcp_options;
-
- extern fsm ipcp_fsm[];
- ***************
- *** 36,41 ****
- --- 51,57 ----
- extern ipcp_options ipcp_hisoptions[];
-
- void ipcp_init();
- + void ipcp_vj_setmode();
- void ipcp_activeopen();
- void ipcp_passiveopen();
- void ipcp_close();
- *** ipcp.c Fri Aug 16 10:30:10 1991
- --- ../ppp/ipcp.c Mon Sep 30 23:51:34 1991
- ***************
- *** 42,51 ****
- #include "fsm.h"
- #include "ipcp.h"
-
- ! short ip_vj_comp = IP_VJ_COMP; /* VJ compression protocol for negotiation. */
- ! /* Change back to 0x0037 for rfc1171 */
- ! /* compatibility */
-
- void ipcp_resetci(); /* Reset our Configuration Information */
- int ipcp_cilen(); /* Return length of our CI */
- void ipcp_addci(); /* Add our CIs */
- --- 42,60 ----
- #include "fsm.h"
- #include "ipcp.h"
-
- ! /*
- ! * VJ compression protocol mode for negotiation. See ipcp.h for a
- ! * description of each mode.
- ! */
- ! static int vj_mode = IPCP_VJMODE_CURRENT;
-
- + static int vj_opt_len = 4; /* holds length in octets for valid vj */
- + /* compression frame depending on mode */
- +
- + static int vj_opt_val = IPCP_VJ_COMP;
- + /* compression negotiation frames */
- + /* depending on vj_mode */
- +
- void ipcp_resetci(); /* Reset our Configuration Information */
- int ipcp_cilen(); /* Return length of our CI */
- void ipcp_addci(); /* Add our CIs */
- ***************
- *** 102,116 ****
- wo->neg_addrs = 1;
- wo->ouraddr = 0;
- wo->hisaddr = 0;
- ! wo->neg_vj = 1; /* XXX We don't do it yet */
-
- ! ao->neg_addrs = 1;
- ! ao->neg_vj = 1; /* XXX We don't do it yet */
-
- fsm_init(&ipcp_fsm[unit]);
- }
-
-
- /*
- * ipcp_activeopen - Actively open IPCP.
- */
- --- 111,167 ----
- wo->neg_addrs = 1;
- wo->ouraddr = 0;
- wo->hisaddr = 0;
- ! wo->neg_vj = 1;
- ! wo->maxslotindex = MAX_STATES - 1; /* really max index */
- ! wo->cflag = 1;
-
- ! /* max slots and slot-id compression are currently hardwired in */
- ! /* ppp_if.c to 16 and 1, this needs to be changed (among other */
- ! /* things) gmc */
-
- + ao->neg_addrs = 1;
- + ao->neg_vj = 1;
- + ao->maxslotindex = MAX_STATES - 1;
- + ao->cflag = 1;
- fsm_init(&ipcp_fsm[unit]);
- }
-
- + /*
- + * ipcp_vj_setmode - set option length and option value for vj
- + * compression negotiation frames depending on mode
- + */
-
- + void
- + ipcp_vj_setmode(mode)
- + int mode;
- + {
- + vj_mode = mode;
- +
- + switch (vj_mode) {
- +
- + case IPCP_VJMODE_OLD:
- + vj_opt_len = 4;
- + vj_opt_val = IPCP_VJ_COMP_OLD;
- + break;
- +
- + case IPCP_VJMODE_CURRENT:
- + vj_opt_len = 4;
- + vj_opt_val = IPCP_VJ_COMP;
- + break;
- +
- + case IPCP_VJMODE_DRAFT: /* draft mode vj compression */
- + vj_opt_len = 6; /* negotiation includes values for */
- + /* maxslot and slot number compression */
- + vj_opt_val = IPCP_VJ_COMP;
- + break;
- +
- + default:
- + fprintf(stderr, "Unknown vj compression mode %d. Please report \
- + this error.\n", vj_mode);
- + break;
- + }
- +
- + }
- /*
- * ipcp_activeopen - Actively open IPCP.
- */
- ***************
- *** 203,209 ****
- {
- ipcp_options *go = &ipcp_gotoptions[f->unit];
-
- ! #define LENCISHORT(neg) (neg ? 4 : 0)
- #define LENCIADDRS(neg) (neg ? 10 : 0)
-
- return (LENCIADDRS(go->neg_addrs) +
- --- 254,262 ----
- {
- ipcp_options *go = &ipcp_gotoptions[f->unit];
-
- !
- ! #define LENCISHORT(neg) (neg ? vj_opt_len : 0)
- !
- #define LENCIADDRS(neg) (neg ? 10 : 0)
-
- return (LENCIADDRS(go->neg_addrs) +
- ***************
- *** 220,231 ****
- {
- ipcp_options *go = &ipcp_gotoptions[f->unit];
-
- ! #define ADDCISHORT(opt, neg, val) \
- if (neg) { \
- PUTCHAR(opt, ucp); \
- ! PUTCHAR(2 + sizeof (short), ucp); \
- PUTSHORT(val, ucp); \
- }
- #define ADDCIADDRS(opt, neg, val1, val2) \
- if (neg) { \
- u_long l; \
- --- 273,290 ----
- {
- ipcp_options *go = &ipcp_gotoptions[f->unit];
-
- !
- ! #define ADDCISHORT(opt, neg, val, maxslotindex, cflag) \
- if (neg) { \
- PUTCHAR(opt, ucp); \
- ! PUTCHAR(vj_opt_len, ucp); \
- PUTSHORT(val, ucp); \
- + if (vj_mode == IPCP_VJMODE_DRAFT) { \
- + PUTCHAR(maxslotindex, ucp); \
- + PUTCHAR(cflag, ucp); \
- + } \
- }
- +
- #define ADDCIADDRS(opt, neg, val1, val2) \
- if (neg) { \
- u_long l; \
- ***************
- *** 238,244 ****
- }
-
- ADDCIADDRS(CI_ADDRS, go->neg_addrs, go->ouraddr, go->hisaddr)
- ! ADDCISHORT(CI_COMPRESSTYPE, go->neg_vj, ip_vj_comp)
- }
-
-
- --- 297,305 ----
- }
-
- ADDCIADDRS(CI_ADDRS, go->neg_addrs, go->ouraddr, go->hisaddr)
- !
- ! ADDCISHORT(CI_COMPRESSTYPE, go->neg_vj, vj_opt_val, go->maxslotindex, go->cflag)
- !
- }
-
-
- ***************
- *** 257,281 ****
- ipcp_options *go = &ipcp_gotoptions[f->unit];
- u_short cilen, citype, cishort;
- u_long cilong;
- !
- /*
- * CIs must be in exactly the same order that we sent...
- * Check packet length and CI length at each step.
- * If we find any deviations, then this packet is bad.
- */
- ! #define ACKCISHORT(opt, neg, val) \
- if (neg) { \
- ! if ((len -= 2 + sizeof (short)) < 0) \
- goto bad; \
- GETCHAR(citype, p); \
- GETCHAR(cilen, p); \
- ! if (cilen != 2 + sizeof (short) || \
- ! citype != opt) \
- goto bad; \
- GETSHORT(cishort, p); \
- if (cishort != val) \
- goto bad; \
- }
- #define ACKCIADDRS(opt, neg, val1, val2) \
- if (neg) { \
- u_long l; \
- --- 318,351 ----
- ipcp_options *go = &ipcp_gotoptions[f->unit];
- u_short cilen, citype, cishort;
- u_long cilong;
- ! u_char cimaxslotindex, cicflag;
- /*
- * CIs must be in exactly the same order that we sent...
- * Check packet length and CI length at each step.
- * If we find any deviations, then this packet is bad.
- */
- ! #define ACKCISHORT(opt, neg, val, maxslotindex, cflag) \
- if (neg) { \
- ! if ((len -= vj_opt_len) < 0) \
- goto bad; \
- GETCHAR(citype, p); \
- GETCHAR(cilen, p); \
- ! if (cilen != vj_opt_len || \
- ! citype != opt) \
- goto bad; \
- GETSHORT(cishort, p); \
- if (cishort != val) \
- goto bad; \
- + if (vj_mode == IPCP_VJMODE_DRAFT) { \
- + GETCHAR(cimaxslotindex, p); \
- + if (cimaxslotindex > maxslotindex) \
- + goto bad; \
- + GETCHAR(cicflag, p); \
- + if (cicflag != cflag) \
- + goto bad; \
- + } \
- }
- +
- #define ACKCIADDRS(opt, neg, val1, val2) \
- if (neg) { \
- u_long l; \
- ***************
- *** 305,312 ****
- }
-
- ACKCIADDRS(CI_ADDRS, go->neg_addrs, go->ouraddr, go->hisaddr)
- ! ACKCISHORT(CI_COMPRESSTYPE, go->neg_vj, ip_vj_comp)
- !
- /*
- * If there are any remaining CIs, then this packet is bad.
- */
- --- 375,381 ----
- }
-
- ACKCIADDRS(CI_ADDRS, go->neg_addrs, go->ouraddr, go->hisaddr)
- ! ACKCISHORT(CI_COMPRESSTYPE, go->neg_vj, vj_opt_val, go->maxslotindex, go->cflag)
- /*
- * If there are any remaining CIs, then this packet is bad.
- */
- ***************
- *** 315,324 ****
- return (1);
- bad:
- IPCPDEBUG((stderr, "ppp: ipcp_ackci: received bad Ack!\n"));
- return (0);
- }
-
- -
- /*
- * ipcp_nakci - NAK some of our CIs.
- *
- --- 384,403 ----
- return (1);
- bad:
- IPCPDEBUG((stderr, "ppp: ipcp_ackci: received bad Ack!\n"));
- +
- + if (vj_mode == IPCP_VJMODE_DRAFT )
- + IPCPDEBUG((stderr, "ppp: ipcp_ackci: citype %d, cilen %l\n",
- + citype, cilen));
- +
- + if (citype == CI_COMPRESSTYPE) {
- + IPCPDEBUG((stderr, "ppp: ipcp_ackci: compress_type %d", cishort));
- + if (vj_mode == IPCP_VJMODE_DRAFT)
- + IPCPDEBUG((stderr, ", maxslotindex %d, cflag %d\n", cishort, cimaxslotindex, cicflag));
- + IPCPDEBUG((stderr, "\n"));
- + }
- return (0);
- }
-
- /*
- * ipcp_nakci - NAK some of our CIs.
- *
- ***************
- *** 332,337 ****
- --- 411,417 ----
- int len;
- {
- ipcp_options *go = &ipcp_gotoptions[f->unit];
- + u_char cimaxslotindex, cicflag;
- u_short cishort;
- u_long ciaddr1, ciaddr2;
-
- ***************
- *** 342,355 ****
- */
- #define NAKCISHORT(opt, neg, code) \
- if (neg && \
- ! len >= 2 + sizeof (short) && \
- ! p[1] == 2 + sizeof (short) && \
- p[0] == opt) { \
- ! len -= 2 + sizeof (short); \
- ! INCPTR(2, p); \
- ! GETSHORT(cishort, p); \
- ! code \
- }
- #define NAKCIADDRS(opt, neg, code) \
- if (neg && \
- len >= 2 + 2 * sizeof (long) && \
- --- 422,440 ----
- */
- #define NAKCISHORT(opt, neg, code) \
- if (neg && \
- ! len >= vj_opt_len && \
- ! p[1] == vj_opt_len && \
- p[0] == opt) { \
- ! len -= vj_opt_len; \
- ! INCPTR(2, p); \
- ! GETSHORT(cishort, p); \
- ! if (vj_mode == IPCP_VJMODE_DRAFT) { \
- ! GETCHAR(cimaxslotindex, p); \
- ! GETCHAR(cicflag, p); \
- ! } \
- ! code \
- }
- +
- #define NAKCIADDRS(opt, neg, code) \
- if (neg && \
- len >= 2 + 2 * sizeof (long) && \
- ***************
- *** 372,380 ****
- go->hisaddr = ciaddr2;
- )
- NAKCISHORT(CI_COMPRESSTYPE, go->neg_vj,
- ! go->neg_vj = 0;
- ! )
-
- /*
- * If there are any remaining CIs, then this packet is bad.
- */
- --- 457,468 ----
- go->hisaddr = ciaddr2;
- )
- NAKCISHORT(CI_COMPRESSTYPE, go->neg_vj,
- ! if (cishort != vj_opt_val)
- ! goto bad;
- ! go->maxslotindex = cimaxslotindex; /* this is what it */
- ! go->cflag = cicflag; /* wants */
-
- + )
- /*
- * If there are any remaining CIs, then this packet is bad.
- */
- ***************
- *** 394,399 ****
- --- 482,488 ----
- int len;
- {
- ipcp_options *go = &ipcp_gotoptions[f->unit];
- + u_char cimaxslotindex, ciflag;
- u_short cishort;
- u_long cilong;
-
- ***************
- *** 404,420 ****
- */
- #define REJCISHORT(opt, neg, val) \
- if (neg && \
- ! len >= 2 + sizeof (short) && \
- ! p[1] == 2 + sizeof (short) && \
- p[0] == opt) { \
- ! len -= 2 + sizeof (short); \
- INCPTR(2, p); \
- GETSHORT(cishort, p); \
- ! /* Check rejected value. */ \
- if (cishort != val) \
- goto bad; \
- neg = 0; \
- ! }
- #define REJCIADDRS(opt, neg, val1, val2) \
- if (neg && \
- len >= 2 + 2 * sizeof (long) && \
- --- 493,514 ----
- */
- #define REJCISHORT(opt, neg, val) \
- if (neg && \
- ! len >= vj_opt_len && \
- ! p[1] == vj_opt_len && \
- p[0] == opt) { \
- ! len -= vj_opt_len; \
- INCPTR(2, p); \
- GETSHORT(cishort, p); \
- ! /* Check rejected value. */ \
- if (cishort != val) \
- goto bad; \
- + if (vj_mode == IPCP_VJMODE_DRAFT) { \
- + GETCHAR(cimaxslotindex, p); \
- + GETCHAR(ciflag, p); \
- + } \
- neg = 0; \
- ! }
- !
- #define REJCIADDRS(opt, neg, val1, val2) \
- if (neg && \
- len >= 2 + 2 * sizeof (long) && \
- ***************
- *** 437,443 ****
- }
-
- REJCIADDRS(CI_ADDRS, go->neg_addrs, go->ouraddr, go->hisaddr)
- ! REJCISHORT(CI_COMPRESSTYPE, go->neg_vj, ip_vj_comp)
-
- /*
- * If there are any remaining CIs, then this packet is bad.
- --- 531,537 ----
- }
-
- REJCIADDRS(CI_ADDRS, go->neg_addrs, go->ouraddr, go->hisaddr)
- ! REJCISHORT(CI_COMPRESSTYPE, go->neg_vj, vj_opt_val)
-
- /*
- * If there are any remaining CIs, then this packet is bad.
- ***************
- *** 472,477 ****
- --- 566,572 ----
- u_char *p = inp; /* Pointer to next char to parse */
- u_char *ucp = inp; /* Pointer to current output char */
- int l = *len; /* Length left */
- + u_char maxslotindex, cflag;
-
- /*
- * Reset all his options.
- ***************
- *** 478,484 ****
- */
- ho->neg_addrs = 0;
- ho->neg_vj = 0;
- !
- /*
- * Process all his options.
- */
- --- 573,581 ----
- */
- ho->neg_addrs = 0;
- ho->neg_vj = 0;
- ! ho->maxslotindex = 0;
- ! ho->cflag = 0;
- !
- /*
- * Process all his options.
- */
- ***************
- *** 551,574 ****
- case CI_COMPRESSTYPE:
- IPCPDEBUG((stderr, "ppp: ipcp_reqci: rcvd COMPRESSTYPE"));
- if (!ao->neg_vj ||
- ! cilen != sizeof (short)) {
- INCPTR(cilen, p);
- orc = CONFREJ;
- break;
- }
- GETSHORT(cishort, p);
- ! LCPDEBUG((stderr, "(%d)", cishort));
- !
- /*
- ! * Compresstype must be ip_vj_comp.
- */
- ! if (cishort != ip_vj_comp) {
- DECPTR(sizeof (short), p);
- orc = CONFNAK;
- ! PUTSHORT(ip_vj_comp, p);
- break;
- }
- ho->neg_vj = 1;
- break;
-
- default:
- --- 648,689 ----
- case CI_COMPRESSTYPE:
- IPCPDEBUG((stderr, "ppp: ipcp_reqci: rcvd COMPRESSTYPE"));
- if (!ao->neg_vj ||
- ! cilen != (vj_opt_len - 2)) {
- INCPTR(cilen, p);
- orc = CONFREJ;
- break;
- }
- GETSHORT(cishort, p);
- ! IPCPDEBUG((stderr, "(%d)", cishort));
- /*
- ! * Compresstype must be vj_opt_val.
- */
- ! if (cishort != vj_opt_val) {
- DECPTR(sizeof (short), p);
- orc = CONFNAK;
- ! PUTSHORT(vj_opt_val, p);
- break;
- }
- ho->neg_vj = 1;
- + if (vj_mode == IPCP_VJMODE_DRAFT) {
- + GETCHAR(maxslotindex, p);
- + if (maxslotindex > wo->maxslotindex) {
- + DECPTR(1, p);
- + orc = CONFNAK;
- + PUTCHAR(wo->maxslotindex, p);
- + break;
- + }
- + ho->maxslotindex = maxslotindex;
- +
- + GETCHAR(cflag, p);
- + if (cflag != wo->cflag) {
- + DECPTR(1, p);
- + orc = CONFNAK;
- + PUTCHAR(wo->cflag, p);
- + break;
- + }
- + ho->cflag = wo->cflag;
- + }
- break;
-
- default:
- *** lcp.h Sat Dec 16 17:06:21 1989
- --- ../ppp/lcp.h Thu Oct 3 15:32:43 1991
- ***************
- *** 59,65 ****
- extern lcp_options lcp_allowoptions[];
- extern lcp_options lcp_hisoptions[];
-
- ! #define DEFMRU 256 /* Try for this */
- #define MINMRU 128 /* No MRUs below this */
-
- void lcp_init();
- --- 59,65 ----
- extern lcp_options lcp_allowoptions[];
- extern lcp_options lcp_hisoptions[];
-
- ! #define DEFMRU 1500 /* Try for this */
- #define MINMRU 128 /* No MRUs below this */
-
- void lcp_init();
- *** patchlevel.h Fri Aug 16 10:30:08 1991
- --- ../ppp/patchlevel.h Fri Oct 4 09:34:38 1991
- ***************
- *** 1 ****
- ! # define PATCHLEVEL 5
- --- 1 ----
- ! # define PATCHLEVEL 6
- *** ppp.c Fri Aug 16 10:30:12 1991
- --- ../ppp/ppp.c Thu Oct 3 22:20:37 1991
- ***************
- *** 122,130 ****
-
-
- void hup(), intr(), term(), alrm(), io(), incdebug(), nodebug();
- ! int setdebug(), setpassive(), noopt(), novj(), noupap(), requpap();
- int setspeed(), noaccomp(), noasyncmap(), noipaddr(), nomagicnumber();
- ! int setasyncmap(), setold();
- int setmru(), nomru(), nopcomp();
- void getuserpasswd();
-
- --- 122,130 ----
-
-
- void hup(), intr(), term(), alrm(), io(), incdebug(), nodebug();
- ! int setdebug(), setpassive(), noopt(), setnovj(), noupap(), requpap();
- int setspeed(), noaccomp(), noasyncmap(), noipaddr(), nomagicnumber();
- ! int setasyncmap(), setvjmode();
- int setmru(), nomru(), nopcomp();
- void getuserpasswd();
-
- ***************
- *** 158,165 ****
- "passive", setpassive, /* Set passive mode */
- "+ua", requpap, /* Require UPAP authentication */
- "-ua", noupap, /* Don't allow UPAP authentication */
- ! "-vj", novj, /* Disable VJ compression */
- ! "old", setold, /* Backward compatibility mode */
- #if 0
- "local", setlocalipaddr,
- "remote", setremoteipaddr,
- --- 158,165 ----
- "passive", setpassive, /* Set passive mode */
- "+ua", requpap, /* Require UPAP authentication */
- "-ua", noupap, /* Don't allow UPAP authentication */
- ! "vjmode", setvjmode, /* set VJ compression mode */
- ! "-vj", setnovj, /* disbale VJ compression */
- #if 0
- "local", setlocalipaddr,
- "remote", setremoteipaddr,
- ***************
- *** 202,209 ****
- passive Set passive mode\n\
- +ua Require UPAP authentication\n\
- -ua Don't allow UPAP authentication\n\
- ! -vj Disable VJ compression\n\
- ! old Backward compatibility mode for use with old PPP versions\n\
- <device> Communicate over the named device\n\
- <speed> Set the baud rate to <speed>\n\
- <loc>:<rem> Set the local and/or remote interface IP\n\
- --- 202,209 ----
- passive Set passive mode\n\
- +ua Require UPAP authentication\n\
- -ua Don't allow UPAP authentication\n\
- ! vjmode <m> VJ compression mode {old, current (default), draft}\n\
- ! -vj disable VJ compression\n\
- <device> Communicate over the named device\n\
- <speed> Set the baud rate to <speed>\n\
- <loc>:<rem> Set the local and/or remote interface IP\n\
- ***************
- *** 1152,1183 ****
-
-
- /*
- ! * novj - Disable Van Jacobson style IP header compression.
- */
- ! int novj(argcp, argvp)
- ! int *argcp;
- ! char ***argvp;
- {
- ! ipcp_wantoptions[0].neg_vj = 0;
- ! ipcp_allowoptions[0].neg_vj = 0;
- ! --*argcp, ++*argvp;
- ! return (1);
- ! }
-
-
- /*
- ! * setold - Set backward compatibility mode
- */
- ! int setold(argcp, argvp)
- int *argcp;
- char ***argvp;
- ! {
- ! extern short ip_vj_comp;
-
- ! ip_vj_comp = 0x0037;
- ! --*argcp, ++*argvp;
- ! return (1);
- ! }
-
- /*
- * Valid speeds.
- --- 1152,1204 ----
-
-
- /*
- ! * setvjmode - Set vj compression mode
- */
- !
- ! int setvjmode(argcp, argvp)
- ! int *argcp;
- ! char ***argvp;
- {
- ! extern int ipcp_vj_mode;
- !
- ! --*argcp, ++*argvp;
-
- + if (!strcmp(**argvp, "old")) { /* "old" mode */
- + ipcp_vj_setmode(IPCP_VJMODE_OLD);
- + }
-
- + else if (!strcmp(**argvp, "current")) { /* "current" mode (default)*/
- + ipcp_vj_setmode(IPCP_VJMODE_CURRENT);
- + }
- +
- + else if (!strcmp(**argvp, "draft")) { /* "draft" mode */
- + ipcp_vj_setmode(IPCP_VJMODE_DRAFT);
- + }
- + else {
- + fprintf(stderr,
- + "Unknown vj compression mode %s. Defaulting to current.\n", **argvp);
- + ipcp_vj_setmode(IPCP_VJMODE_CURRENT);
- + }
- + --*argcp, ++*argvp;
- +
- + return (1);
- + }
- /*
- ! * setnovj - diable vj compression
- */
- !
- ! int setnovj(argcp, argvp)
- int *argcp;
- char ***argvp;
- ! {
- ! extern int ipcp_vj_mode;
- !
- ! --*argcp, ++*argvp;
- ! ipcp_wantoptions[0].neg_vj = 0;
- ! ipcp_allowoptions[0].neg_vj = 0;
-
- ! return (1);
- ! }
-
- /*
- * Valid speeds.
- *** slcompress.c Sun Apr 22 15:32:04 1990
- --- ../ppp/slcompress.c Mon Sep 30 23:51:27 1991
- ***************
- *** 41,47 ****
- #endif
-
- #define BCMP(p1, p2, n) bcmp((char *)(p1), (char *)(p2), (int)(n))
- ! #define BCOPY(p1, p2, n) bcopy((char *)(p1), (char *)(p2), (int)(n))
- #ifndef KERNEL
- #define ovbcopy bcopy
- #endif
- --- 41,47 ----
- #endif
-
- #define BCMP(p1, p2, n) bcmp((char *)(p1), (char *)(p2), (int)(n))
- ! #define SL_BCOPY(p1, p2, n) bcopy((char *)(p1), (char *)(p2), (int)(n))
- #ifndef KERNEL
- #define ovbcopy bcopy
- #endif
- ***************
- *** 327,333 ****
- * state with this packet's header.
- */
- deltaA = ntohs(th->th_sum);
- ! BCOPY(ip, &cs->cs_ip, hlen);
-
- /*
- * We want to use the original packet as our compressed packet.
- --- 327,333 ----
- * state with this packet's header.
- */
- deltaA = ntohs(th->th_sum);
- ! SL_BCOPY(ip, &cs->cs_ip, hlen);
-
- /*
- * We want to use the original packet as our compressed packet.
- ***************
- *** 355,361 ****
- m->m_off += hlen;
- *cp++ = deltaA >> 8;
- *cp++ = deltaA;
- ! BCOPY(new_seq, cp, deltaS);
- INCR(sls_compressed)
- return (TYPE_COMPRESSED_TCP);
-
- --- 355,361 ----
- m->m_off += hlen;
- *cp++ = deltaA >> 8;
- *cp++ = deltaA;
- ! SL_BCOPY(new_seq, cp, deltaS);
- INCR(sls_compressed)
- return (TYPE_COMPRESSED_TCP);
-
- ***************
- *** 365,371 ****
- * to use on future compressed packets in the protocol field).
- */
- uncompressed:
- ! BCOPY(ip, &cs->cs_ip, hlen);
- ip->ip_p = cs->cs_id;
- comp->last_xmit = cs->cs_id;
- return (TYPE_UNCOMPRESSED_TCP);
- --- 365,371 ----
- * to use on future compressed packets in the protocol field).
- */
- uncompressed:
- ! SL_BCOPY(ip, &cs->cs_ip, hlen);
- ip->ip_p = cs->cs_id;
- comp->last_xmit = cs->cs_id;
- return (TYPE_UNCOMPRESSED_TCP);
- ***************
- *** 397,403 ****
- hlen = ip->ip_hl;
- hlen += ((struct tcphdr *)&((int *)ip)[hlen])->th_off;
- hlen <<= 2;
- ! BCOPY(ip, &cs->cs_ip, hlen);
- cs->cs_ip.ip_sum = 0;
- cs->cs_hlen = hlen;
- INCR(sls_uncompressedin)
- --- 397,403 ----
- hlen = ip->ip_hl;
- hlen += ((struct tcphdr *)&((int *)ip)[hlen])->th_off;
- hlen <<= 2;
- ! SL_BCOPY(ip, &cs->cs_ip, hlen);
- cs->cs_ip.ip_sum = 0;
- cs->cs_hlen = hlen;
- INCR(sls_uncompressedin)
- ***************
- *** 496,502 ****
- cp -= cs->cs_hlen;
- len += cs->cs_hlen;
- cs->cs_ip.ip_len = htons(len);
- ! BCOPY(&cs->cs_ip, cp, cs->cs_hlen);
- *bufp = cp;
-
- /* recompute the ip header checksum */
- --- 496,502 ----
- cp -= cs->cs_hlen;
- len += cs->cs_hlen;
- cs->cs_ip.ip_len = htons(len);
- ! SL_BCOPY(&cs->cs_ip, cp, cs->cs_hlen);
- *bufp = cp;
-
- /* recompute the ip header checksum */
- *** slstats.c Sat May 19 13:29:40 1990
- --- ../ppp/slstats.c Fri Oct 4 09:43:54 1991
- ***************
- *** 37,43 ****
- #include <errno.h>
- #include <nlist.h>
- #include <stdio.h>
- - #include <stdio.h>
- #include <signal.h>
- #include <net/if.h>
- #include <netinet/in.h>
- --- 37,42 ----
-